package com.delay.queue.delayedqueue.quartz;

import org.quartz.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author gxing
 * @desc 任务配置
 * @date 2021/3/17
 */
//@Configuration
//public class QuartzConfig {
//
//    @Bean
//    public JobDetail quartzDetail(){
//        return JobBuilder.newJob(QuartzTask.class).withIdentity("quartzTask").storeDurably().build();
//    }
//
//    @Bean
//    public Trigger testQuartzTrigger(){
//        SimpleScheduleBuilder scheduleBuilder = SimpleScheduleBuilder.simpleSchedule()
//                .withIntervalInSeconds(2)  //设置时间周期,单位秒
//                .repeatForever();
//        return TriggerBuilder.newTrigger().forJob(quartzDetail())
//                .withIdentity("quartzTrigger")
//                .withSchedule(scheduleBuilder)
//                .build();
//    }
//}
